/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Frontera;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

/**
 *
 * @author alexis
 */
public class ImagenFondo extends javax.swing.JPanel {

    private BufferedImage image;

    public ImagenFondo() {
        initComponents();
         try {                
          image = ImageIO.read(new File(System.getProperty("user.dir") + System.getProperty("file.separator")+"imagenes"+System.getProperty("file.separator")+"imagen_alpha1.png"));
       } catch (IOException ex) {
            // handle exception...
       }
    }
 @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(image, 0, 0, null); // see javadoc for more info on the parameters            
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BRegistrarSolicitud = new javax.swing.JButton();
        BBuscarMuestras = new javax.swing.JButton();
        BBuscarSolicitudes = new javax.swing.JButton();
        BBuscarClientes = new javax.swing.JButton();
        BSeguimientoCustodia = new javax.swing.JButton();
        BSalir = new javax.swing.JButton();

        BRegistrarSolicitud.setText("Registrar Solicitud");
        BRegistrarSolicitud.setBorder(null);
        BRegistrarSolicitud.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BRegistrarSolicitudActionPerformed(evt);
            }
        });

        BBuscarMuestras.setText("Buscar Muestras");
        BBuscarMuestras.setBorder(null);
        BBuscarMuestras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BBuscarMuestrasActionPerformed(evt);
            }
        });

        BBuscarSolicitudes.setText("Buscar Solicitudes");
        BBuscarSolicitudes.setBorder(null);
        BBuscarSolicitudes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BBuscarSolicitudesActionPerformed(evt);
            }
        });

        BBuscarClientes.setText("Buscar Clientes");
        BBuscarClientes.setBorder(null);
        BBuscarClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BBuscarClientesActionPerformed(evt);
            }
        });

        BSeguimientoCustodia.setText("Seguimiento Custodia");
        BSeguimientoCustodia.setBorder(null);
        BSeguimientoCustodia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BSeguimientoCustodiaActionPerformed(evt);
            }
        });

        BSalir.setText("Salir");
        BSalir.setBorder(null);
        BSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(327, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BSeguimientoCustodia, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BBuscarClientes, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BBuscarSolicitudes, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BBuscarMuestras, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BRegistrarSolicitud, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(38, 38, 38))
            .addGroup(layout.createSequentialGroup()
                .addGap(210, 210, 210)
                .addComponent(BSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(124, 124, 124)
                .addComponent(BRegistrarSolicitud, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BBuscarMuestras, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BBuscarSolicitudes, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BBuscarClientes, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BSeguimientoCustodia, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(BSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void BSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BSalirActionPerformed
        System.exit(0);
    }//GEN-LAST:event_BSalirActionPerformed

    private void BRegistrarSolicitudActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BRegistrarSolicitudActionPerformed
          SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                FRegistroSolicitud registroSolicitud = new FRegistroSolicitud();
                registroSolicitud.setVisible(true);
            }
        });
    }//GEN-LAST:event_BRegistrarSolicitudActionPerformed

    private void BBuscarMuestrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BBuscarMuestrasActionPerformed
          SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FConsultaMuestra().setVisible(true);
            }
        });
    }//GEN-LAST:event_BBuscarMuestrasActionPerformed

    private void BBuscarSolicitudesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BBuscarSolicitudesActionPerformed
          SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                FBuscarSolicitudes consultaSolicitudes = new FBuscarSolicitudes();          
                consultaSolicitudes.setVisible(true);
            }
        });
    }//GEN-LAST:event_BBuscarSolicitudesActionPerformed

    private void BBuscarClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BBuscarClientesActionPerformed
          SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FBuscarClientes((MenuPrincipalAlterno) ImagenFondo.this.getTopLevelAncestor()).setVisible(true);
            }
        });
    }//GEN-LAST:event_BBuscarClientesActionPerformed

    private void BSeguimientoCustodiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BSeguimientoCustodiaActionPerformed
           SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                FCustodia custodia = new FCustodia();        
                custodia.setVisible(true);
            }
        });
    }//GEN-LAST:event_BSeguimientoCustodiaActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BBuscarClientes;
    private javax.swing.JButton BBuscarMuestras;
    private javax.swing.JButton BBuscarSolicitudes;
    private javax.swing.JButton BRegistrarSolicitud;
    private javax.swing.JButton BSalir;
    private javax.swing.JButton BSeguimientoCustodia;
    // End of variables declaration//GEN-END:variables
}
